//
//  QLMServiceMidTabCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/14.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMServiceMidTabCell.h"

@implementation QLMServiceMidTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(CGFloat)autoChangeHeightWithLabel:(UILabel *)textLabel{
    CGSize constraint = CGSizeMake(kScreen_width-90,CGFLOAT_MAX);
    CGRect size = [textLabel.text boundingRectWithSize:constraint
                                               options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingTruncatesLastVisibleLine)
                                            attributes:@{NSFontAttributeName:textLabel.font}
                                               context:nil];
    
    CGFloat textHeight = size.size.height;
    return textHeight;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifiew=@"QLMServiceMidTabCellId";
    QLMServiceMidTabCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLMServiceMidTabCell" owner:nil options:nil] firstObject];
        
        UIFont *aFont=[UIFont systemFontOfSize:16];
        cell.storeNameLabel.font=aFont;
        cell.storeAddressLabel.font=aFont;
        cell.storeAddrTipLabel.font=aFont;
        cell.storeNameTipLabel.font=aFont;
        
    }
    return cell;
}

@end
